package ouyangye;

public abstract class shape {
    private String name;

    public shape(String name){
        this.name=name;
    }

    public abstract double Area();//面积
    public abstract double Long();//周长

    public void display(){
        System.out.println("图形名称:"+name);
        System.out.println("面积:"+String.format("%.1f",Area()));
        System.out.println("周长:"+String.format("%.1f",Long()));
    }

    public String getName(){
        return name;
    }
    public void setName(String name){
        this.name=name;
    }
}
